package com.meisupic.copyright.domain.vo;

import static com.meisupic.copyright.common.Constants.DIC_TYPE_NAME_STATUS;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.meisupic.copyright.util.DictionaryUtil;
import java.io.Serializable;
import java.sql.Timestamp;
import lombok.Data;

/**
 * 数据字典类
 *
 * creation wuxun
 * @Date 下午4:08 2017/12/8
 */
@Data
public class SysDicVo implements Serializable {

  private static final long serialVersionUID = -8047963851797694319L;

  private String id;

  private String type;

  private String code;

  private String text;

  private Integer sortNo;

  private String remark;

  /**
   * 是否启用
   */
  private Integer enable;

  private String enableName;

  private Integer editable;

  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
  private Timestamp createTime;

  public SysDicVo() {

  }

  public SysDicVo(String type, String code, String text, Integer sortNo,
      String remark) {
    this.type = type;
    this.code = code;
    this.text = text;
    this.sortNo = sortNo;
    this.remark = remark;

  }


  public String getEnableName() {
    return DictionaryUtil.getDicNameByValue(String.valueOf(this.getEnable()), DIC_TYPE_NAME_STATUS);
  }
}
